<?php
class EventView {
	private $firstname = "förnamn";
	private $lastname = "efternamn";
	public function EventBox($list = "") {

		
		$html = "<ul class='list'>";
		foreach ($list as $event) {
			$html .= "<li>$event[2] $event[3]</li>";
		}
		$html .= "</ul>";
		return $html;

	}

	public function ApplyToEvent() {
		$NavigationView = new NavigationView();
		return "
					<div id='registration' class='registertoform'>
						<h2>Registera dig</h2>
							<form name='login'  id='RegisterUserForm' method='Post' action='" . $NavigationView-> GetUrlToEventIndex() . "'>
								<fieldset>
									<p>
										<label class='label' for='name'>Förnamn:</label>
										</label><input type='text' size='20' name='$this->firstname' id='name' class='text' value='' />
									</p>
									<p>	
										<label class='label' for='name'>Efternamn:</label>
										<input type='text' size='20' name='$this->lastname' class='text' id='name' value='' />
									</p>
									<div class='Apply'>
									<form name='Apply' id='apply' method='Post' action='" . $NavigationView-> GetUrlToEventIndex() . "'>
										<input type='submit' name='submit' id='submit' value='Anmäl dig!'/>
										<input type='hidden' name='GoToEvent'  />
									</form>
								</div>
						</fieldset>
					</form>
				</div>";
	}
	public function DeleteFromEvent(){
				$NavigationView = new NavigationView();
						return "
						<form name='Apply' id='apply' method='Post' action='" . $NavigationView-> GetUrlToEventIndex() . "'>
							<input type='submit' name='deleteSubmit' id='submit' value='Avregistera dig!'/> 
							<input type='hidden' name='GoToEvent'  />
						</form>";
	}



	public function TriedToEvent() {
		if (isset($_POST["submit"])) {
			Return True;
		}
		return FALSE;

	}
		public function TriedToDelete() {
		if (isset($_POST["deleteSubmit"])) {
			Return True;
		}
		return FALSE;

	}
	public function GetFirstName() {
		if (isset($_POST[$this -> firstname])) {

			return $_POST[$this -> firstname];

		}
	}

	public function GetLastName() {

		if (isset($_POST[$this -> lastname])) {
			$_SESSION[$this -> lastname] = $lastname;
			return $_POST[$this -> lastname];

		}
	}


}
